#pragma once

#include <atomic>

class Lock
{
private:
	std::atomic<bool> LockState;

public:
	Lock(void) :
		LockState(false)
	{
	}

	~Lock(void)
	{
	}

	inline void Lock(void)
	{
		while (LockState.exchange(true)) {} // das spinlock selbst
	}

	inline void Unlock(void)
	{
		LockState = false; // unlock
	}
};